package com.fc.test.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.fc.test.common.base.BaseService;
import com.fc.test.common.support.Convert;
import com.fc.test.mapper.auto.TAbbCountMapper;
import com.fc.test.model.auto.TAbbCount;
import com.fc.test.model.auto.TAbbCountExample;
import com.fc.test.model.custom.Tablepar;
import com.fc.test.util.SnowflakeIdWorker;

/**
 * 后台账户表Service
* @Title: TAbbCountService.java 
* @Package com.fc.test.entity 
* @author fuce
* @email 87766867@qq.com
* @date 2019-08-29 10:58:29  
 */
@Service
public class TAbbCountService implements BaseService<TAbbCount, TAbbCountExample>{
	@Autowired
	private TAbbCountMapper tAbbCountMapper;

	/**
	 * 分页查询
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	 public PageInfo<TAbbCount> list(Tablepar tablepar,String name){
	        TAbbCountExample testExample=new TAbbCountExample();
	        testExample.setOrderByClause("id ASC");
	        if(name!=null&&!"".equals(name)){
	        	testExample.createCriteria().andYuliu1Like("%"+name+"%");
	        }

	        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
	        List<TAbbCount> list= tAbbCountMapper.selectByExample(testExample);
	        PageInfo<TAbbCount> pageInfo = new PageInfo<TAbbCount>(list);
	        return  pageInfo;
	 }

	@Override
	public int deleteByPrimaryKey(String ids) {
		List<String> lista=Convert.toListStrArray(ids);
		TAbbCountExample example=new TAbbCountExample();
		//example.createCriteria().andIdIn(lista);
		return tAbbCountMapper.deleteByExample(example);
	}


	@Override
	public TAbbCount selectByPrimaryKey(String id) {

		return tAbbCountMapper.selectByPrimaryKey(id);
	}


	@Override
	public int updateByPrimaryKeySelective(TAbbCount record) {
		return tAbbCountMapper.updateByPrimaryKeySelective(record);
	}

	/**
	 * 添加
	 */
	@Override
	public int insertSelective(TAbbCount record) {
		//添加雪花主键id
		//record.setId(SnowflakeIdWorker.getUUID());
		return tAbbCountMapper.insertSelective(record);
	}










	@Override
	public int updateByExampleSelective(TAbbCount record, TAbbCountExample example) {

		return tAbbCountMapper.updateByExampleSelective(record, example);
	}


	@Override
	public int updateByExample(TAbbCount record, TAbbCountExample example) {

		return tAbbCountMapper.updateByExample(record, example);
	}

	@Override
	public List<TAbbCount> selectByExample(TAbbCountExample example) {

		return tAbbCountMapper.selectByExample(example);
	}


	@Override
	public long countByExample(TAbbCountExample example) {

		return tAbbCountMapper.countByExample(example);
	}


	@Override
	public int deleteByExample(TAbbCountExample example) {

		return tAbbCountMapper.deleteByExample(example);
	}




}
